package com.qiaoanju.commons.utils;

/**
 * 字符串处理
 * Created by zhangchong
 * on 2017/9/21.
 */
public class StringUtil {

    /**
     * 将字符串按照指定regx分隔，
     * 转化为int数组
     * @param str
     * @param regx
     * @return
     */
    public static int[] getIntArryFromString(String str,String regx){

        String[] arr = str.split(regx);
        int[] arrInt = new int[arr.length];
        for(int i = 0; i < arr.length; i++){
            arrInt[i] = Integer.parseInt( arr[i]);
        }
        return arrInt;
    }

}
